<template>
  <div class="plays">
    <div @click="seekHandler">
      播放到指定的位置
    </div>
    <div id="dplayer" />
  </div>
</template>
<script>
export default {
  data () {
    return {
      DP: null
    }
  },
  mounted () {
    window.Hls = require('hls.js')
    const DPlayer = require('dplayer')
    const dp = new DPlayer({
      container: document.getElementById('dplayer'),
      autoplay: true,
      video: {
        url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4',
        type: 'normal'
      }
    })
    this.DP = dp
    console.log(dp.plugins.hls) // Hl
  },
  methods: {
    seekHandler () {
      this.DP.seek(10)
      this.DP.play()
    }
  }
}
</script>
<style lang="scss" scoped>
.plays/deep/ {
  .dplayer-controller .dplayer-icons .dplayer-setting,
  .dplayer-controller .dplayer-icons .dplayer-subtitle-btn {
    display: none ;
  }
}
</style>
